package vip.xiaonuo.facedoor.rule;

import cn.hutool.extra.spring.SpringUtil;
import com.deliveredtechnologies.rulebook.RuleState;
import com.deliveredtechnologies.rulebook.annotation.Given;
import com.deliveredtechnologies.rulebook.annotation.Rule;
import com.deliveredtechnologies.rulebook.annotation.Then;
import com.deliveredtechnologies.rulebook.annotation.When;
import lombok.extern.slf4j.Slf4j;
import vip.xiaonuo.facedoor.iservice.megvii.IMemberChangeService;

@Rule
@Slf4j
public class KSRulesEngine {

    @Given("manufacturer")
    private ManufacturerEnums manufacturer;


    public static IMemberChangeService memberChangeService;

    @When
    public boolean when() {
        return ManufacturerEnums.KS.equals(this.manufacturer);
    }

    @Then
    public RuleState then() {
        log.info("旷视规则引擎启动加载类");
        memberChangeService = SpringUtil.getBean(RuleConstant.KS + RuleConstant.MEMBER_DEAL_WITH);

        return RuleState.NEXT;
    }

}
